package loan.calc.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

@EqualsAndHashCode
@Data
public abstract class BaseEntity implements Serializable {

    @Schema(description = "乐观锁")
    @TableField(fill = FieldFill.INSERT)
    @Version
    protected Integer version = 0;

//    @Schema(description = "是否删除")
//    private Integer deleted;

    @Schema(description = "创建人")
    @TableField(fill = FieldFill.INSERT)
    protected Long createdBy;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    protected LocalDateTime createdTime;

    @Schema(description = "更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    protected Long updatedBy;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    protected LocalDateTime updatedTime;

}
